/**
 * Created By: sisopipo Project Team
 * Created Date: Feb 25, 2011
 */
package com.sisopipo.assetsportal.security.domain;

import java.util.Date;

/**
 * @author ribin
 * @version 1.0
 */
public class User {

	/** PK */
	private String id;

	/** login account */
	private String userId;

	/** user name (Chinese/English name) */
	private String userName;

	/** password */
	private String password;

	private Date updateTime;

	/** whether is default system user */
	private boolean systemUser = false;

	/** user role */
	private Role role;

	public boolean authenticate(String inputPwd) {
		if (inputPwd == null)
			return false;

		// TODO validate password
		return inputPwd.equals(password);
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public boolean isSystemUser() {
		return systemUser;
	}

	public void setSystemUser(boolean systemUser) {
		this.systemUser = systemUser;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

}
